home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-13 / mg2a_src.zip / TERMLIB / ISDIGIT.C < prev    next >
C/C++ Source or Header  |  1988-08-23  |  1KB  |  57 lines

  1. /************************************************************************
  2.  *                                      *
  3.  *              Copyright (c) 1982, Fred Fish              *
  4.  *              All Rights Reserved                  *
  5.  *                                      *
  6.  *    This software and/or documentation is released for public          *
  7.  *    distribution for personal, non-commercial use only.          *
  8.  *    Limited rights to use, modify, and redistribute are hereby      *
  9.  *    granted for non-commercial purposes, provided that all          *
  10.  *    copyright notices remain intact and all changes are clearly     *
  11.  *    documented.  The author makes no warranty of any kind with      *
  12.  *    respect to this product and explicitly disclaims any implied    *
  13.  *    warranties of merchantability or fitness for any particular     *
  14.  *    purpose.                                  *
  15.  *                                      *
  16.  ************************************************************************
  17.  */
  18.  
  19.  
  20.  
  21.  
  22. /*
  23.  *  LIBRARY FUNCTION
  24.  *
  25.  *    isdigit     test character for numeric property
  26.  *
  27.  *  SYNOPSIS
  28.  *
  29.  *    int isdigit(ch)
  30.  *    char ch;
  31.  *
  32.  *  DESCRIPTION
  33.  *
  34.  *    Returns TRUE or FALSE depending upon whether the specified
  35.  *    character is a numeric character or not.
  36.  *
  37.  *  BUGS
  38.  *
  39.  *    May fail on machines in which native character set is not ASCII.
  40.  *
  41.  */
  42.  
  43. #include <stdio.h>
  44.  
  45. #define TRUE 1
  46. #define FALSE 0
  47.  
  48. int isdigit(ch)
  49. char ch;
  50. {
  51.     if (ch > '9' || ch < '0') {
  52.       return(FALSE);
  53.     } else {
  54.       return(TRUE);
  55.     }
  56. }
  57.